package org.sibutu.plugin.struts2.jcr.wrapper;

import org.sibutu.kernel.persistence.jcr.utils.JcrSecurityHelper;

import javax.jcr.Node;

/**
 * Factory for instantiating Sibutu node wrappers
 * @see SibutuNodeWrapperImpl
 */
public class SibutuNodeWrapperFactory extends SimpleNodeWrapperFactory {
  JcrSecurityHelper jcrSecurityHelper;

  public NodeWrapper createWrapped(Node node) {
    return (NodeWrapper) (node instanceof SibutuNodeWrapperImpl || node==null?node:new SibutuNodeWrapperImpl(node,this, jcrSecurityHelper));
  }

  public void setJcrSecurityHelper(JcrSecurityHelper jcrSecurityHelper) {
    this.jcrSecurityHelper = jcrSecurityHelper;
  }
}